﻿<Window x:Class="WMSSoft.WinKStart.Settings_NewEditDSCustomItem"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{Binding ViewName}" 
        x:Name="SettingsNewEditDSCustomItem"
        Height="395" Width="455" ResizeMode="NoResize" ShowInTaskbar="True" WindowStartupLocation="CenterOwner" Icon="/WinKStart;component/grfx/preferences-other.png" WindowStyle="ToolWindow">
    <Window.Resources>
        <DataTemplate x:Key="cmbTemplate">
            <WrapPanel Margin="0 0 0 0" Height="18">
                <Image Width="18" Height="18" Stretch="Fill" Source="{Binding Image}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,5,0"/>
                <Label Content="{Binding Value}" HorizontalAlignment="Center" FontSize="12" Margin="0,-5,0,-5"/>
            </WrapPanel>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="19*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="1" Orientation="Horizontal" FlowDirection="RightToLeft" >
            <Button Content="{Binding Cmd_CloseClick.ViewName}" Height="23" HorizontalAlignment="Right" Margin="10,10,0,5" Width="100" IsCancel="True" Command="{Binding Cmd_CloseClick.Command}" CommandParameter="{Binding ElementName=SettingsNewEditDSCustomItem}" TabIndex="21" />
            <Button Content="{Binding Cmd_OkClick.ViewName}" Height="23" HorizontalAlignment="Right" Margin="5,10,0,5" Width="100" IsCancel="True" Command="{Binding Cmd_OkClick.Command}" CommandParameter="{Binding ElementName=SettingsNewEditDSCustomItem}" TabIndex="20" />
        </StackPanel>
        <Grid Margin="10,10,10,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="25"/>
                <RowDefinition Height="25"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="25"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Label Content="Name:" HorizontalAlignment="Left" Padding="0,0,0,0" Margin="0,2,0,0" VerticalAlignment="Top" TabIndex="0"/>
            <TextBox Grid.Column="1" TextWrapping="Wrap" Margin="0,0,0,5" Text="{Binding ItemName}" VerticalContentAlignment="Center"  TabIndex="1" IsEnabled="{Binding CanEditName}"/>
            <Label Content="Caption:" HorizontalAlignment="Left" Padding="0,0,0,0" Margin="0,1,0,0" VerticalAlignment="Top" Grid.Row="1" TabIndex="2"/>
            <TextBox Grid.Column="1" Grid.Row="1" TextWrapping="Wrap" Margin="0,0,0,5" Text="{Binding ItemCaption}" VerticalContentAlignment="Center" Height="20" TabIndex="3"/>
            <Label Content="Type:" HorizontalAlignment="Left" Padding="0,0,0,0" Margin="0,2,0,0" VerticalAlignment="Top" Grid.Row="2" TabIndex="4"/>
            <ComboBox  Margin="0,0,0,5" Grid.Row="2" Grid.Column="1"  SelectedValue="{Binding SelectedItemType}" SelectedValuePath="Key" DisplayMemberPath="Value"  ItemsSource="{Binding ItemTypeItems}" TabIndex="5" />
            <Label Content="Execution Type:" HorizontalAlignment="Left" Padding="0,0,0,0" Margin="0,1,0,0" VerticalAlignment="Top" Grid.Row="3" TabIndex="6"/>
            <ComboBox VerticalAlignment="Top"  Margin="0,0,0,5" Grid.Column="1" Grid.Row="3" SelectedValue="{Binding SelectedExecutionType}" SelectedValuePath="Key" DisplayMemberPath="Value"  ItemsSource="{Binding ExecutionTypeItems}" TabIndex="7"/>
            <Label Content="Execution Procedure:" HorizontalAlignment="Left" Margin="0,4,0,0" Padding="0,0,5,0" VerticalAlignment="Top" Grid.Row="4" TabIndex="11"/>
            <ComboBox VerticalAlignment="Top"  Margin="0,0,0,5" Grid.Column="1" Grid.Row="4" SelectedValue="{Binding SelectedExecutionProcedure}" SelectedValuePath="Key" DisplayMemberPath="Value"  ItemsSource="{Binding ExecutionProcedureItems}" IsEnabled="{Binding CanEditProcedure}" TabIndex="12"/>
            <Label Content="Command:" Grid.Column="0" Grid.Row="5" Padding="0" Margin="0,3,5,0" TabIndex="13" />
            <Grid Grid.Column="1" Grid.Row="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="49*"/>
                    <ColumnDefinition Width="23*"/>
                    <ColumnDefinition Width="221*"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBox x:Name="txt_CustomItemCommand" Grid.Column="0" TextWrapping="Wrap" Margin="0,0,0,7" Text="{Binding ItemCommand}" VerticalContentAlignment="Center" IsEnabled="{Binding CanEditCommand}" Height="20" TabIndex="9" Grid.ColumnSpan="3" />
                <Button Width="20" Height="20" Grid.Column="3" Content="{Binding Cmd_ChooseFilter.ViewName}" Margin="0,-4,0,5" Padding="0" Command="{Binding Cmd_ChooseFilter.Command}" CommandParameter="{Binding ElementName=txt_RegionFilter}" IsEnabled="{Binding CanEditCommand}" TabIndex="10" />
            </Grid>
            <Label Content="Arguments:" Grid.Column="0" Grid.Row="6" Padding="0" Margin="0,3,5,0" TabIndex="13" />
            <TextBox Grid.Column="1" Grid.Row="6" TextWrapping="Wrap" Margin="0,0,0,5" Text="{Binding ItemCommandArguments}" VerticalContentAlignment="Center" Height="20" IsEnabled="{Binding CanEditCommand}" TabIndex="3"/>
            <Label Content="Working Dir.:" Grid.Column="0" Grid.Row="7" Padding="0" Margin="0,3,5,0" TabIndex="13" />
            <Grid Grid.Column="1" Grid.Row="7">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBox x:Name="txt_CustomItemWorkingDir" Grid.Column="0" TextWrapping="Wrap" Margin="0,0,0,5" Text="{Binding ItemWorkingDirectory}" VerticalContentAlignment="Center" IsEnabled="{Binding CanEditCommand}" Height="20" IsReadOnly="True" TabIndex="9" />
                <Button Width="20" Height="20" Grid.Column="1" Content="{Binding Cmd_ChooseFilter.ViewName}" Margin="0,-5,0,0" Padding="0" Command="{Binding Cmd_ChooseFilter.Command}" CommandParameter="{Binding ElementName=txt_RegionFilter}" IsEnabled="{Binding CanEditCommand}" TabIndex="10" />
            </Grid>
            <Label Content="PanelID:" Grid.Column="0" Grid.Row="8" Padding="0" Margin="0,3,5,0" TabIndex="13" />
            <TextBox Grid.Column="1" Grid.Row="8" TextWrapping="Wrap" Margin="0,0,0,5" Text="{Binding PanelID}" VerticalContentAlignment="Center" Height="20" TabIndex="3"/>
            <Label Content="Image:" Grid.Column="0" Grid.Row="9" Padding="0" Margin="0,3,5,0" TabIndex="13" />
            <ComboBox VerticalAlignment="Top"  Margin="0,0,0,5" Grid.Column="1" Grid.Row="9" ItemTemplate="{StaticResource cmbTemplate}" SelectedValue="{Binding SelectedImage}"  ItemsSource="{Binding AvailableCustomImages}" TabIndex="7"/>
            <Label Content="Filter:" HorizontalAlignment="Left" Margin="0,0,0,0" Padding="0,3,0,5" VerticalAlignment="Top" Grid.Row="10" TabIndex="8"/>
            <Grid Grid.Column="1" Grid.Row="10">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <TextBox x:Name="txt_CustomItemFilter" Grid.Column="0" TextWrapping="Wrap" Margin="0,0,0,5" Text="{Binding Filter}" VerticalContentAlignment="Center" IsEnabled="{Binding EnableNameChanging}" Height="20" IsReadOnly="True" TabIndex="9" />
                <Button Width="20" Height="20" Grid.Column="1" Content="{Binding Cmd_ChooseFilter.ViewName}" Margin="0,-5,0,0" Padding="0" Command="{Binding Cmd_ChooseFilter.Command}" CommandParameter="{Binding ElementName=txt_RegionFilter}" IsEnabled="{Binding CanChooseFilter}" TabIndex="10" />
            </Grid>
            <Label Content="Comment:" Grid.Column="0" Grid.Row="11" Padding="0" Margin="0,3,5,0" TabIndex="13" />
            <TextBox Grid.Column="1" Grid.Row="11" TextWrapping="Wrap" Margin="0,0,0,5" Text="{Binding Comment}" VerticalContentAlignment="Center" Height="20" TabIndex="3"/>

        </Grid>
    </Grid>
</Window>
